﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Utils
{
	public static class TimeSpanExtension
	{
		/// <summary>
		/// 
		/// </summary>
		/// <param name="task"></param>
		/// <param name="d">毫秒</param>
		public static void Delay(this long length)
		{
			int remainder = (int)(length % (TimeSpan.TicksPerDay));
			long count= length  /TimeSpan.TicksPerDay;
			for (int i = 0; i < count; i++) { 

				Task.Delay(new TimeSpan(TimeSpan.TicksPerDay)).Wait();
			}
			Task.Delay(new TimeSpan(remainder)).Wait();
		}
	}
}
